package io.renren.modules.edu.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import io.renren.common.page.PageData;
import io.renren.common.service.impl.CrudServiceImpl;
import io.renren.modules.edu.dao.EduAaDao;
import io.renren.modules.edu.dto.EduAaDTO;
import io.renren.modules.edu.dto.EduClazzDTO;
import io.renren.modules.edu.dto.EduStudentDTO;
import io.renren.modules.edu.entity.EduAaEntity;
import io.renren.modules.edu.entity.EduStudentEntity;
import io.renren.modules.edu.service.EduAaService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * xuesheng
 *
 * @author Mark sunlightcs@gmail.com
 * @since 1.0.0 2023-04-20
 */
@Service
public class EduAaServiceImpl extends CrudServiceImpl<EduAaDao, EduAaEntity, EduAaDTO> implements EduAaService {
    @Override
    public PageData<EduAaDTO> page(Map<String,Object> params){
        //转换成like
        paramsToLike(params, "name");

        //分页
        IPage<EduAaEntity> page = getPage(params,null, false);
        //查询
        List<EduAaEntity> list = baseDao.getList(params);

        return getPageData(list, page.getTotal(), EduAaDTO.class);
    }



    @Override
    public QueryWrapper<EduAaEntity> getWrapper(Map<String, Object> params){
        return null;
//        String id = (String)params.get("id");
//        String name=(String)params.get("name");
//
//        QueryWrapper<EduAaEntity> wrapper = new QueryWrapper<>();
//        wrapper.like(StringUtils.isNotBlank(id), "id", id);
//        wrapper.like(StringUtils.isNotBlank(name),"name",name);
//
//        return wrapper;
    }

}